<template>
  <div>
    <div>基础信息</div>
    <div class="pw100 flex_aj column">
      <r-list :ListRows="ListRows" :ListData="ListData"></r-list>
      <el-button
        v-if="ListData.state == 2"
        class="mt20"
        type="success"
        @click="handle"
        >处理</el-button
      >
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      ListRows: [
        [
          {
            label: "反馈单号",
            prop: "id"
          },
          {
            label: "反馈User",
            prop: "nickName"
          },
          {
            label: "反馈内容",
            prop: "remark"
          },
          {
            label: "Status",
            prop: "state",
            formatter: e => (e.state == 1 ? "已处理" : "未处理")
          },
          // {
          //     label: '处理结果',
          //     prop: 'handleResult',
          // },
          {
            label: "反馈Type",
            prop: "type"
          },
          {
            label: "Phone码",
            prop: "phone"
          },
          {
            label: "反馈图片",
            prop: "picture",
            type: "img",
            imglook: true
          },
          {
            label: "处理人",
            prop: "updatedBy"
          },
          {
            label: "处理时间",
            prop: "updatedTime"
          }
        ]
      ],
      ListData: {
        id: 1,
        nickName: "张三丰",
        remark: "哎哎哎",
        state: "1",
        type: "",
        picture: []
      }
    };
  },
  components: {},
  computed: {},
  mounted() {
    this.init();
  },
  methods: {
    async init() {
      let res = await this.api.feedbackList({
        page: 1,
        limit: 10,
        id: this.$route.query.id
      });
      if (res) {
        this.ListData = res.data.list[0];
      }
    },
    async handle() {
      const that = this;
      this.$prompt("处理Remarks", "Hint", {
        confirmButtonText: "Confirm",
        cancelButtonText: "Cancel"
        // inputPattern: '\S+',
      })
        .then(async ({ value }) => {
          let res = await that.api.feedbackupdate({
            id: that.$route.query.id,
            handleRemark: value
          });
          if (res) {
            this.$message({
              type: "success",
              message: "SubmitSuccess"
            });
          } else {
            this.$message({
              type: "error",
              message: "SubmitFailure"
            });
          }
        })
        .catch(() => {});
    }
  }
};
</script>
<style scoped lang="scss"></style>
